package cn.tedu.thread;

import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个数字:");
        for (int i=scan.nextInt();i>0;i--){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                System.out.println("线程sleep中断异常");
            }
            System.out.println("倒计时开始:"+i);
        }
        System.out.println("程序运行结束");
    }
}
